<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增信息系统管理')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-management-add">
            <h4 class="form-header h4">信息系统管理信息</h4>
            <div class="form-group">    
                <label class="col-sm-3 control-label">企业名称：</label>
                <div class="col-sm-8">
                    <input name="enterpriseName" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">系统名称：</label>
                <div class="col-sm-8">
                    <input name="systemName" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">系统用途：</label>
                <div class="col-sm-8">
                    <select name="systemType" class="form-control m-b" th:with="type=${@dict.getType('info_system_type')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">开发时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="systemCreatetime" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">等保级别：</label>
                <div class="col-sm-8">
                    <select name="securityLevel" class="form-control m-b" th:with="type=${@dict.getType('info_security_level')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">安全员：</label>
                <div class="col-sm-8">
                    <select name="securityOfficer" class="form-control m-b">
                        <option value="">所有</option>
                        <option value="凌凌漆">凌凌漆</option>
                    </select>
                    <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">网络安全保障措施：</label>
                <div class="col-sm-8">
                    <select name="securityStep" class="form-control m-b">
                        <option value="">所有</option>
                        <option value="安全保护措施法1">安全保护措施法1</option>
                    </select>
                    <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">数据安全员：</label>
                <div class="col-sm-8">
                    <select name="dataSecurityOfficer" class="form-control m-b">
                        <option value="">所有</option>
                        <option value="零零一">零零一</option>
                    </select>
                    <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">数据安全保障措施：</label>
                <div class="col-sm-8">
                    <select name="dataSecurityStep" class="form-control m-b">
                        <option value="">所有</option>
                        <option value="代码防删回滚法">代码防删回滚法</option>
                    </select>
                    <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
                </div>
            </div>
<!--            <h4 class="form-header h4">系统评价信息</h4>-->
<!--            <div class="row">-->
<!--                <div class="col-sm-12">-->
<!--                    <button type="button" class="btn btn-white btn-sm" onclick="addColumn()"><i class="fa fa-plus"> 增加</i></button>-->
<!--                    <button type="button" class="btn btn-white btn-sm" onclick="sub.delColumn()"><i class="fa fa-minus"> 删除</i></button>-->
<!--                    <div class="col-sm-12 select-table table-striped">-->
<!--                        <table id="bootstrap-table"></table>-->
<!--                    </div>-->
<!--                </div>-->
<!--            </div>-->
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "system/management"
        $("#form-management-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-management-add').serialize());
            }
        }

        $("input[name='systemCreatetime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $(function() {
            var options = {
                pagination: false,
                showSearch: false,
                showRefresh: false,
                showToggle: false,
                showColumns: false,
                sidePagination: "client",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'index',
                    align: 'center',
                    title: "序号",
                    formatter: function (value, row, index) {
                    	var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index));
                    	return columnIndex + $.table.serialNumber(index);
                    }
                },
                {
                    field: 'createTime',
                    align: 'center',
                    title: '评价时间',
                    formatter: function(value, row, index) {
                        var html = $.common.sprintf("<input class='form-control' type='text' name='infoEvaluateList[%s].createTime' value='%s'>", index, value);
                        return html;
                    }
                },
                {
                    field: 'evaluateContent',
                    align: 'center',
                    title: '系统评价',
                    formatter: function(value, row, index) {
                        var html = $.common.sprintf("<input class='form-control' type='text' name='infoEvaluateList[%s].evaluateContent' value='%s'>", index, value);
                        return html;
                    }
                },
                {
                    field: 'proposalContent',
                    align: 'center',
                    title: '优化建议',
                    formatter: function(value, row, index) {
                        var html = $.common.sprintf("<input class='form-control' type='text' name='infoEvaluateList[%s].proposalContent' value='%s'>", index, value);
                        return html;
                    }
                
                }]
            };
            $.table.init(options);
        });

        function addColumn() {
            var count = $("#" + table.options.id).bootstrapTable('getData').length;
            sub.editColumn();
        	
            $("#" + table.options.id).bootstrapTable('insertRow', {
                index: count,
                row: {
                    index: $.table.serialNumber(count),
                    createTime: "",
                    evaluateContent: "",
                    proposalContent: ""
                }
            });
        }
    </script>
</body>
</html>